package com.sunstar.club.subject.common.enums;

import lombok.Getter;

/**
 * 题目类型枚举
 * 1-单选 2-多选 3-判断 4-简答
 *
 * @Author: Shylo Sun
 * @Project: track-club
 * @Date: 2024/2/24 10:38
 */
@Getter
public enum SubjectInfoTypeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答");

    private int code;
    private String desc;

    SubjectInfoTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectInfoTypeEnum getByCode(int codeValue) {
        for (SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()) {
            if (resultCodeEnum.code == codeValue) {
                return resultCodeEnum;
            }
        }
        return null;
    }

}
